package com.xfcy.blog.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xfcy.blog.common.constant.Constant;
import com.xfcy.blog.common.constant.DateConstant;
import com.xfcy.blog.entity.Menu;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 晓风残月Lx
 * @date 2023/5/15 21:26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MenuVO {

    @ApiModelProperty(value = "主键")
    private Integer id;

    @ApiModelProperty(value = "上级资源ID")
    private Integer parentId;

    @ApiModelProperty(value = "url")
    private String url;

    @ApiModelProperty(value = "资源编码")
    private String component;

    @ApiModelProperty(value = "资源名称")
    private String title;

    @ApiModelProperty(value = "资源级别")
    private Integer level;

    @ApiModelProperty(value = "排序")
    private Integer sortNo;

    @ApiModelProperty(value = "资源图标")
    private String icon;

    @ApiModelProperty(value = "类型 menu、button")
    private String type;

    @ApiModelProperty(value = "资源名字")
    private String name;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "是否显示")
    private Integer hidden;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = DateConstant.FORMAT_STRING, timezone = DateConstant.GMT_TIMEZONE)
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "最后更新时间")
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateConstant.FORMAT_STRING, timezone = DateConstant.GMT_TIMEZONE)
    private LocalDateTime updateTime;

    private List<MenuVO> children;
}
